// 配置跨越携带cookie 和证书
import axios from 'axios';
import login from '../../vapp-helper/utils/login.js';

axios.defaults.withCredentials = true;
axios.defaults.timeout = 50000;
window._UIDesingerAxios = axios;
window._xvueAxios = axios;

// 请求预处理
axios.interceptors.request.use(
  config => {
    login.requestUse(config);
    return config;
  },
  err => Promise.reject(err),
);

axios.interceptors.response.use(
  response => response,
  error => Promise.reject(error),
);
